// 引入Service和请求头ServiceName
import { Service, ServiceName } from '@/network/http.js'
import store from '@/store/index.js' // 引入store

const api = {
  /**
    * 获取主列表
    */
  queryAll (params) {
    return Service.get(
      `/${ServiceName}/api/external/TYardLoadingListController/queryAll`, { params }
    )
  },
  /**
    * 获取清单
    */
  selectTYardInOut (params) {
    return Service.get(
      `/${ServiceName}/api/external/TYardLoadingListController/selectTYardInOut`, { params }
    )
  },
  /**
    * 获取件号 cargoInfoId/stackPosition
    */
  selectPieceNo (params) {
    return Service.get(
      `/${ServiceName}/api/external/TYardLoadingListController/selectPieceNo`, { params }
    )
  },
  /**
    * 新增
    */
  insert (params) {
    store.commit('changeStatus', true)
    return Service.post(
      `/${ServiceName}/api/external/TYardLoadingListController/insert`, params
    )
  },
  /**
    * 回显
    */
  selectTYardLoadingList (params) {
    return Service.get(
      `/${ServiceName}/api/external/TYardLoadingListController/selectTYardLoadingList`, {params}
    )
  },
  /**
    * 删除
    */
   deleteById (params) {
    return Service.post(
      `/${ServiceName}/api/external/TYardLoadingListController/deleteById`, params
    )
  },
}
export default api